// Author: Ivan Chau
package uk.ac.cam.kcic2.scene;

import java.util.ArrayList;

import uk.ac.cam.kcic2.math.RotationX;
import uk.ac.cam.kcic2.math.RotationY;
import uk.ac.cam.kcic2.math.Transform;
import uk.ac.cam.kcic2.math.Translation;


public class Box extends CompoundObject {
	
	
	public final Plane front, back, left, right, top, bottom;

	// unit box with botton front left corner at centre in local coordinates
	public Box(ArrayList<Transform> trans, ColourCoeffs frontCoeffs,ColourCoeffs leftCoeffs,ColourCoeffs rightCoeffs, 
			ColourCoeffs backCoeffs, ColourCoeffs topCoeffs, ColourCoeffs bottomCoeffs, CompoundObject father){
		super(trans, father);
		ArrayList<Transform> backWallTrans = new ArrayList<Transform>();
		backWallTrans.add(new Translation(0,0,1));
		back = new Plane(backWallTrans, backCoeffs, this);	
		
		ArrayList<Transform> leftWallTrans = new ArrayList<Transform>();
		leftWallTrans.add(new Translation(0,0,1));
		leftWallTrans.add(new RotationY(Math.PI/2));
		left = new Plane(leftWallTrans, leftCoeffs, this);
		
		ArrayList<Transform> rightWallTrans = new ArrayList<Transform>();
		rightWallTrans.add(new Translation(1,0,1));
		rightWallTrans.add(new RotationY(Math.PI/2));
		right = new Plane(rightWallTrans, rightCoeffs, this);
		
		ArrayList<Transform> ceilingTrans = new ArrayList<Transform>();
		ceilingTrans.add(new Translation(0,1,1));
		ceilingTrans.add(new RotationX(-Math.PI/2));
		top = new Plane(ceilingTrans, topCoeffs, this);
		
		ArrayList<Transform> floorTrans = new ArrayList<Transform>();
		floorTrans.add(new Translation(0,0,1));
		floorTrans.add(new RotationX(-Math.PI/2));
		bottom = new Plane(floorTrans, bottomCoeffs, this);
				
		front = new Plane(null, frontCoeffs, this);		
		/*
		ArrayList<Transform> backWallTrans = new ArrayList<Transform>();
		backWallTrans.add(new Translation(0,0,1));
		back = new Plane(backWallTrans, wcoeffs, this);	
		
		ArrayList<Transform> leftWallTrans = new ArrayList<Transform>();
		leftWallTrans.add(new Translation(0,0,1));
		leftWallTrans.add(new RotationY(Math.PI/2));
		left = new Plane(leftWallTrans, rcoeffs, this);
		
		ArrayList<Transform> rightWallTrans = new ArrayList<Transform>();
		rightWallTrans.add(new Translation(1,0,1));
		rightWallTrans.add(new RotationY(Math.PI/2));
		right = new Plane(rightWallTrans, gcoeffs, this);
		
		ArrayList<Transform> ceilingTrans = new ArrayList<Transform>();
		ceilingTrans.add(new Translation(0,1,1));
		ceilingTrans.add(new RotationX(-Math.PI/2));
		top = new Plane(ceilingTrans, wcoeffs, this);
		
		ArrayList<Transform> floorTrans = new ArrayList<Transform>();
		floorTrans.add(new Translation(0,0,1));
		floorTrans.add(new RotationX(-Math.PI/2));
		bottom = new Plane(floorTrans, wcoeffs, this);*/
		
		this.addChild(front);
		this.addChild(back);
		this.addChild(left);
		this.addChild(right);
		this.addChild(top);
		this.addChild(bottom);
	}

}
